﻿/* send set item (site/subset/relay) state command
        state 
        0 : off 
        1 : on 
        2 : mixed
        3 : unknown

lid : 
    site_<#> : 현재 site_1만 지원
    subset_<#>
    relay_<bid>_<rid>
*/

/* relays 
    {"name": "축제가로수1", "lid": "relay_0_0", "state": 3},
    {"name": "축제가로수2", "lid": "relay_0_1", "state": 3},
    {"name": "조각1",       "lid": "relay_0_2", "state": 3},
    {"name": "조각2",       "lid": "relay_0_3", "state": 3},
    {"name": "조각3",       "lid": "relay_0_4", "state": 3},
    {"name": "조각4",       "lid": "relay_1_0", "state": 3},
    {"name": "조각간판",    "lid": "relay_1_1", "state": 3},
    {"name": "spare",       "lid": "relay_1_2", "state": 3},
    {"name": "spare2",      "lid": "relay_1_3", "state": 3},
    {"name": "spare3",      "lid": "relay_1_4", "state": 3},
    {"name": "축제마당1",   "lid": "relay_2_0", "state": 3},
    {"name": "축제마당2",   "lid": "relay_2_1", "state": 3},
    {"name": "축제마당3",   "lid": "relay_2_2", "state": 3},
    {"name": "축제마당4",   "lid": "relay_2_3", "state": 3},
    {"name": "spare4",      "lid": "relay_2_4", "state": 3},
    {"name": "오솔길1",     "lid": "relay_3_0", "state": 3},
    {"name": "오솔길2",     "lid": "relay_3_1", "state": 3},
    {"name": "건물투시등1", "lid": "relay_3_2", "state": 3},
    {"name": "건물투시등2", "lid": "relay_3_3", "state": 3},
    {"name": "spare5",      "lid": "relay_3_4", "state": 3},
    {"name": "소나무",      "lid": "relay_4_0", "state": 3},
    {"name": "도로간판",    "lid": "relay_4_1", "state": 3},
    {"name": "spare6",      "lid": "relay_4_2", "state": 3},
    {"name": "spare7",      "lid": "relay_4_3", "state": 3},
    {"name": "spare8",      "lid": "relay_4_4", "state": 3},
    {"name": "바닥조명1",   "lid": "relay_5_0", "state": 3},
    {"name": "바닥조명2",   "lid": "relay_5_1", "state": 3},
    {"name": "바닥조명3",   "lid": "relay_5_2", "state": 3},
    {"name": "spare9",      "lid": "relay_5_3", "state": 3},
    {"name": "spare10",     "lid": "relay_5_4", "state": 3},
    {"name": "옥상1",       "lid": "relay_6_0", "state": 3},
    {"name": "옥상2",       "lid": "relay_6_1", "state": 3},
    {"name": "옥상3",       "lid": "relay_6_2", "state": 3},
    {"name": "spare11",     "lid": "relay_6_3", "state": 3},
    {"name": "spare12",     "lid": "relay_6_4", "state": 3},
    {"name": "옥상4",       "lid": "relay_7_0", "state": 3},
    {"name": "spare13",     "lid": "relay_7_1", "state": 3},
    {"name": "spare14",     "lid": "relay_7_2", "state": 3},
    {"name": "spare15",     "lid": "relay_7_3", "state": 3},
    {"name": "spare16",     "lid": "relay_7_4", "state": 3},
    {"name": "가로등1",     "lid": "relay_8_0", "state": 3},
    {"name": "가로등2",     "lid": "relay_8_1", "state": 3},
    {"name": "가로등3",     "lid": "relay_8_2", "state": 3},
    {"name": "가로등4",     "lid": "relay_8_3", "state": 3},
    {"name": "간판3",       "lid": "relay_8_4", "state": 3},

subsets
   "name": "조각공원",        "lid": "subset_1", "state": 3,
   "name": "축제마당 가로수", "lid": "subset_2", "state": 3,
   "name": "축제마당",        "lid": "subset_3", "state": 3,
   "name": "오솔길",          "lid": "subset_4", "state": 3,
   "name": "건물투시등",      "lid": "subset_5", "state": 3,
   "name": "소나무투광",      "lid": "subset_6", "state": 3,
   "name": "바닥조명",        "lid": "subset_7", "state": 3,
   "name": "옥상경관",        "lid": "subset_8", "state": 3,
   "name": "가로등",          "lid": "subset_9", "state": 3,
   "name": "간판",            "lid": "subset_10", "state": 3,

*/
var layout = {
    // site 대가야역사문화파크
    "name": "대가야", "lid": "site_1",  "state": 3,
    "children": [
        // subset1
        { "name": "조각공원",        "lid": "subset_1", "state": 3,
        "children": [
            // subset1's child
            {"name": "조각1",       "lid": "relay_0_2", "state": 3},
            {"name": "조각2",       "lid": "relay_0_3", "state": 3},
            {"name": "조각3",       "lid": "relay_0_4", "state": 3},
            {"name": "조각4",       "lid": "relay_1_0", "state": 3}
        ]},
        { "name": "축제마당 가로수", "lid": "subset_2", "state": 3,
        "children": [
            {"name": "축제가로수1", "lid": "relay_0_0", "state": 3},
            {"name": "축제가로수2", "lid": "relay_0_1", "state": 3}
        ]},
        { "name": "축제마당",        "lid": "subset_3", "state": 3,
        "children": [
            {"name": "축제마당1",   "lid": "relay_2_0", "state": 3},
            {"name": "축제마당2",   "lid": "relay_2_1", "state": 3},
            {"name": "축제마당3",   "lid": "relay_2_2", "state": 3},
            {"name": "축제마당4",   "lid": "relay_2_3", "state": 3}
        ]},
        { "name": "오솔길",          "lid": "subset_4", "state": 3,
        "children": [
            {"name": "오솔길1",     "lid": "relay_3_0", "state": 3},
            {"name": "오솔길2",     "lid": "relay_3_1", "state": 3}
        ]},
        { "name": "건물투시등",      "lid": "subset_5", "state": 3,
        "children": [
            {"name": "건물투시등1", "lid": "relay_3_2", "state": 3},
            {"name": "건물투시등2", "lid": "relay_3_3", "state": 3}
        ]},
        { "name": "소나무투광",      "lid": "subset_6", "state": 3,
        "children": [
            {"name": "소나무",      "lid": "relay_4_0", "state": 3}
        ]},
        { "name": "바닥조명",        "lid": "subset_7", "state": 3,
        "children": [
            {"name": "바닥조명1",   "lid": "relay_5_0", "state": 3},
            {"name": "바닥조명2",   "lid": "relay_5_1", "state": 3},
            {"name": "바닥조명3",   "lid": "relay_5_2", "state": 3}
        ]},
        { "name": "옥상경관",        "lid": "subset_8", "state": 3,
        "children": [
            {"name": "옥상1",       "lid": "relay_6_0", "state": 3},
            {"name": "옥상2",       "lid": "relay_6_1", "state": 3},
            {"name": "옥상3",       "lid": "relay_6_2", "state": 3},
            {"name": "옥상4",       "lid": "relay_7_0", "state": 3}
        ]},
        { "name": "가로등",          "lid": "subset_9", "state": 3,
        "children": [
            {"name": "가로등1",     "lid": "relay_8_0", "state": 3},
            {"name": "가로등2",     "lid": "relay_8_1", "state": 3},
            {"name": "가로등3",     "lid": "relay_8_2", "state": 3},
            {"name": "가로등4",     "lid": "relay_8_3", "state": 3}
        ]},
        { "name": "간판",            "lid": "subset_10", "state": 3,
        "children": [
            {"name": "조각간판",    "lid": "relay_1_1", "state": 3},
            {"name": "도로간판",    "lid": "relay_4_1", "state": 3},
            {"name": "간판3",       "lid": "relay_8_4", "state": 3}
        ]}
/* not operate because layout xml doesn't include the relays
        ,{ "name": "미사용",            "lid": "subset_10", "state": 3,
        "children": [
            {"name": "spare",       "lid": "relay_1_2", "state": 3},
            {"name": "spare2",      "lid": "relay_1_3", "state": 3},
            {"name": "spare3",      "lid": "relay_1_4", "state": 3},
            {"name": "spare4",      "lid": "relay_2_4", "state": 3},
            {"name": "spare5",      "lid": "relay_3_4", "state": 3},
            {"name": "spare6",      "lid": "relay_4_2", "state": 3},
            {"name": "spare7",      "lid": "relay_4_3", "state": 3},
            {"name": "spare8",      "lid": "relay_4_4", "state": 3},
            {"name": "spare9",      "lid": "relay_5_3", "state": 3},
            {"name": "spare10",     "lid": "relay_5_4", "state": 3},
            {"name": "spare11",     "lid": "relay_6_3", "state": 3},
            {"name": "spare12",     "lid": "relay_6_4", "state": 3},
            {"name": "spare13",     "lid": "relay_7_1", "state": 3},
            {"name": "spare14",     "lid": "relay_7_2", "state": 3},
            {"name": "spare15",     "lid": "relay_7_3", "state": 3},
            {"name": "spare16",     "lid": "relay_7_4", "state": 3}
        ]}
 */
    ]
};